package com.jswlw.service.biz.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.jswlw.dao.biz.RepairInfoMapper;
import com.jswlw.entity.biz.RepairInfo;
import com.jswlw.service.biz.RepairInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RepairInfoServiceImpl implements RepairInfoService {

    @Autowired
    RepairInfoMapper mapper;

    @Override
    public void add(RepairInfo repairInfo) {
        mapper.insertSelective(repairInfo);
    }

    @Override
    public void update(RepairInfo repairInfo) {
        mapper.updateByPrimaryKeySelective(repairInfo);
    }

    @Override
    public void delete(Integer id) {
        mapper.deleteByPrimaryKey(id);
    }

    @Override
    public RepairInfo find4Id(Integer id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<RepairInfo> queryList(RepairInfo filter) {
        return mapper.queryList(filter);
    }

    @Override
    public Page<RepairInfo> queryPage(RepairInfo repairInfo, Integer offset, Integer limit) {
        PageHelper.startPage(offset,limit);
        return (Page<RepairInfo>) mapper.queryList(repairInfo);
    }
}
